<template>
  <div id="Recommend">
    <div class="recommend">
      <div class="more">
        <p>推荐歌单</p>
        <div @click="goSongList()">
          <p>更多</p>
          <span class="bobafont bobamusic-youjiantou1"></span>
        </div>
      </div>
      <div class="songMenu">
        <div
          class="playlsit"
          v-for="(item, index) in recommendsonglist"
          :key="index"
          @click="goSonglistinformationlist(item)"
        >
          <img :src="item.picUrl+'?param=100y100'" width="100%" height="100%" />
          <div class="introduce">{{ item.name }}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { Darecommendsonglist } from "network/api/RecommendApi";
export default {
  name: "Recommend",
  data() {
    return {
      recommendsonglist: [],
    };
  },
  methods: {
    goSongList() {
      this.$router.push({ path: "/songlist" });
    },
    goSonglistinformationlist(item) {
      this.$router.push({ name: "songlistinformationlist",params:{item}});
    },
  },
  mounted() {
    Darecommendsonglist().then((res) => {
      this.recommendsonglist = res.data.recommend;
    });
  },
};
</script>

<style scoped>
#Recommend .recommend {
  position: relative;
  margin-top: 10px;
}
#Recommend .recommend .more {
  position: relative;
  top: 80px;
  width: 90%;
  height: 30px;
  display: flex;
  margin: 0 auto;
  justify-content: space-between;
  /* background: red; */
}
#Recommend .recommend .more p {
  font-weight: bold;
  color: #2ae0c8;
  margin-top: 10px;
}
#Recommend .recommend .more div {
  width: 16%;
  height: 70%;
  /* background: red; */
  border-radius: 50px;
  margin-top: 7px;
  border: 1px solid rgb(224, 224, 224);
  display: flex;
}
#Recommend .recommend .more div p {
  font-size: 15px;
  margin-top: 2px;
  margin-left: 6px;
}
#Recommend .recommend .more div .bobafont {
  color: #2ae0c8;
}
#Recommend .recommend .songMenu {
  position: absolute;
  width: 99%;
  height: 120px;
  top: 120px;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
}
#Recommend .recommend .songMenu .playlsit {
  height: 80px;
  float: left;
  min-width: 90px;
  left: 20px;
  /* background: red; */

  margin-top: 0;
  border-radius: 10px;
}
#Recommend .recommend .songMenu .playlsit:nth-child(1) {
  margin-left: 20px;
}
#Recommend .recommend .songMenu .playlsit:nth-child(2) {
  margin-left: 10px;
}
#Recommend .recommend .songMenu .playlsit:nth-child(3) {
  margin-left: 10px;
}
#Recommend .recommend .songMenu .playlsit:nth-child(4) {
  margin-left: 10px;
}
#Recommend .recommend .songMenu .playlsit:nth-child(5) {
  margin-left: 10px;
}
#Recommend .recommend .songMenu .playlsit:nth-child(6) {
  margin-left: 10px;
}
#Recommend .recommend .songMenu .playlsit:nth-child(7) {
  margin-left: 10px;
}
.recommend .songMenu .playlsit img {
  border-radius: 10px;
}
#Recommend .recommend .songMenu::-webkit-scrollbar {
  background-color: transparent;
  display: none;
}
#Recommend .recommend .songMenu .playlsit .introduce {
  display: flex;
  color: #2ae0c8;
  /* width: 80%; */
  font-size: 10px;
  overflow: hidden; /*溢出的部分隐藏*/
  text-overflow: ellipsis; /*显示省略符号来代表被修剪的文本*/
  display: -webkit-box;
  -webkit-line-clamp: 2; /*显示两行*/
  -webkit-box-orient: vertical; /*从上向下垂直排列*/
}
</style>